//
//  MainTableViewCell_FirstSection.m
//  BigTyre
//
//  Created by 田涛 on 2017/3/30.
//  Copyright © 2017年 Lemon. All rights reserved.
//

#import "MainTableViewCell_FirstSection.h"
#import "MyButton.h"
#import "Common.h"

@interface MainTableViewCell_FirstSection ()
@property (nonatomic, strong) MyButton *btn;
@property (nonatomic, strong) UILabel *bottomLine;
@end

@implementation MainTableViewCell_FirstSection
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initBtns];
    }
    return self;
}

- (void)initBtns {
    CGFloat width = WIDTH / 4;
    NSArray *titleArr = @[@"轮胎知识",@"行业动态",@"展会信息",@"更多"];
    NSArray *img = @[@"home_zhishi",@"home_dongtai",@"home_message",@"home_more"];
    for (int i = 0; i < 4; i++) {
        _btn = [MyButton buttonWithFrame:CGRectMake(i * width, 0, width, width-5) title:titleArr[i] titleColor:[UIColor blackColor] image:img[i]];
        [self addSubview:self.btn];
    }
    _bottomLine = [[UILabel alloc] initWithFrame:CGRectMake(0, width - 5, WIDTH, 5)];
    _bottomLine.backgroundColor = [UIColor colorWithRed:(238/255.0) green:(238/255.0) blue:(238/255.0) alpha:1];
    [self addSubview:self.bottomLine];
}

@end
